#include <iostream>
#include <math.h>
using std::cout;
using std::endl;
class Point;

class Line{
public:
    float distance(const Point & lhs,const Point & rhs);
};
class Point{
public:
    Point(int x,int y)
    :_ix(x)
     ,_iy(y)
    {

    }
friend
    float Line::distance(const Point & lhs,const Point & rhs);

private:
    int _ix;
    int _iy;
};

float Line::distance(const Point & lhs,const Point & rhs){
    return sqrt((lhs._ix - rhs._ix)*(lhs._ix - rhs._ix) +   //error，有问题，不知道Point的具体实现
                (lhs._iy - rhs._iy)*(lhs._iy - rhs._iy));
}

void test(){
    Point pt1(0,0), pt2(3, 4);
    Line l;
    cout <<l.distance(pt1, pt2) << endl;
}

int main()
{
    test();
    return 0;
}

